﻿@* Calling a helper method that will go through all of the parent nodes of the current page, recursively. *@
@RecurseParentNodes(Model)

@Model.Name

@helper RecurseParentNodes(dynamic node) 
{
  var renderNode = node.Parent;
  @* If this parent node doesn't exist, or if we've reached 
        the home page, jump out of the helper, there's no more breadcrumbs to show then *@
  if (renderNode == null || node.NodeTypeAlias == "Home")
  {
    return;
  }
  
  @RecurseParentNodes(renderNode) 
  
  <a href="@renderNode.Url">@(renderNode.Level == 1 ? "Home" : renderNode.Name)</a> <text>>></text>
}